package TUILayer;
import java.util.Scanner;
import ControllerLayer.*;

/**
 * Write a description of class MainMenuUI here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class MainMenuUI
{
    // instance variables - replace the example below with your own

    private CostumerUI costumerUI;
    private SalesmanUI salesmanUI;
    private ProductUI productUI;
    private OrderUI orderUI;

    /**
     * Constructor for objects of class MainMenuUI
     */
    public MainMenuUI()
    {
        // initialise instance variables

    }

    public void mainMenuStart()
    {
        boolean exit = false;

        while(!exit)  //if exit = true, the main menu will shut down 
        {
            int choice = writeMainMenu();
            switch(choice)
            {
                case 1:
                startOrderUI();
                break;
                case 2:
                startSalesmanUI();
                break;
                case 3:
                startCostumerUI();
                break;                
                case 4:
                startProductUI();
                break;
                case 5:
                System.out.println("coming sone");   
                break;
                default:
                writeEnd();
                exit = true;
                break; 
            }
        }
    }

    public int writeMainMenu()
    {
        Scanner keyboard = new Scanner(System.in);
        System.out.println("\f ****MainMenu ***");
        System.out.println("  (1) ORDER");
        System.out.println("  (2) SALESMAN");
        System.out.println("  (3) COSTUMER");
        System.out.println("  (4) STORE");
        System.out.println("  (5) PRINT");
        System.out.println("  (6+) Exit");
        System.out.println("\n make your choice: ");

        int choice = keyboard.nextInt();

        return choice;

    } 

    public void startOrderUI()
    {
        orderUI = new OrderUI();
        orderUI.start();
    }

    public void startCostumerUI()
    {
        costumerUI = new CostumerUI();
        costumerUI.start();
    }

    public void startSalesmanUI()
    {
        salesmanUI = new SalesmanUI();
        salesmanUI.start();
    }

    public void startProductUI()
    {
        productUI = new ProductUI();
        productUI.start();
    }    

    public void writeEnd()
    {
        System.out.println("  The System is shutting down  ");
    }

    //to more menus here are standards methods as comments
    //     public void create()
    //     {
    //         Scanner keyboard = new Scanner(System.in);
    //         
    //         System.out.println();
    //         System.out.println("press any to continue");
    //         keyboard.nextLine();
    //     }
    //     
    //     public void read()
    //     {
    //     
    //         Scanner keyboard = new Scanner(System.in);
    //         
    //         System.out.println();
    //         System.out.println("press any to continue");
    //         keyboard.nextLine();
    //     }
    //     
    //     public void update()
    //     {
    //         Scanner keyboard = new Scanner(System.in);
    //         
    //         System.out.println();
    //         System.out.println("press any to continue");
    //         keyboard.nextLine();
    //     }
    //     
    //     public void delete()
    //     {
    //         Scanner keyboard = new Scanner(System.in);
    //         
    //         System.out.println();
    //         System.out.println("press any to continue");
    //         keyboard.nextLine();
    //     }
    //     
    //     public void printID()
    //     {
    //         Scanner keyboard = new Scanner(System.in);
    //         
    //         System.out.println();
    //         System.out.println("press any to continue");
    //         keyboard.nextLine();
    //     }
    //     
    //     public void printAll()
    //     {
    //         Scanner keyboard = new Scanner(System.in);
    //         
    //         System.out.println();
    //         System.out.println("press any to continue");
    //         keyboard.nextLine();
    //     }

}
